package com.cx.thread.test;

import java.util.LinkedList;

public class Queue {
    public static void main(String[] args) throws InterruptedException {
        // 消息队列
        LinkedList<String> queue = new LinkedList<>();
        // 模拟2个生产者
        Producter zs = new Producter("zs",queue);
        Producter ls = new Producter("ls",queue);
        // 生成两个生产线程
        new Thread(new ProducterRunnable(zs)).start();
        new Thread(new ProducterRunnable(ls)).start();

        // 模拟1个消费者
        Consumer ww = new Consumer("ww",queue);
        // 生成1个消费线程
        new Thread(new ConSumerRunnable(ww)).start();
    }
}